var n = getApp();

Page({
    data: {
        language: "",
        withdrawToWechat: 0,
        withdrawToAlipay: 0,
        coin_name: "",
        froze: "0.00",
        usable: "0.00",
        withdraw_proportion: 0,
        bllw: 0,
        balance: 0,
        balance_money: ""
    },
    onLoad: function(n) {
        this.setData({
            balance_money: ""
        }), this.getData();
    },
    onReady: function() {
        var n = wx.getStorageSync("langIndex");
        this.setData({
            language: n.en
        });
    },
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var a = this, o = n.getNetAddresss("plugin.coin.Frontend.Controllers.page.index");
        n._getNetWork({
            url: o,
            success: function(n) {
                var o = n.data;
                1 === o.result ? a.setData({
                    withdraw_proportion: o.data.withdraw_proportion,
                    froze: o.data.froze,
                    usable: o.data.usable,
                    coin_name: o.data.coin_name
                }) : wx.showToast({
                    title: o.msg,
                    icon: "none"
                });
            },
            fail: function(n) {
                console.log(n);
            }
        });
    },
    confirm: function() {
        if (this.data.balance_money) {
            var a = n.getNetAddresss("plugin.coin.Frontend.Modules.Coin.Controllers.withdraw.index");
            a += "&change_value=" + this.data.balance_money, n._getNetWork({
                url: a,
                success: function(n) {
                    console.log(n, "数据"), 1 === n.data.result ? wx.navigateTo({
                        url: "/packageA/member/withdrawal/withdrawal"
                    }) : wx.showToast({
                        title: n.data.msg,
                        icon: "none"
                    });
                },
                fail: function(n) {
                    console.log(n);
                }
            });
        } else wx.showToast({
            title: "提现金额不能为空",
            icon: "none"
        });
    },
    onChange: function(n) {
        this.setData({
            balance_money: n.detail
        });
    }
});